import axios from '@/libs/api.request'

export const addCache = (data) => {
  return axios.request({
    url: 'databases/manage/',
    data,
    method: 'post'
  })
}

export const cacheList = (region) => {
  const params = {
    'region': region
  }
  return axios.request({
    url: 'databases/manage/',
    params,
    method: 'get'
  })
}

export const connectStatus = (id) => {
  return axios.request({
    url: 'databases/redis_opration/',
    params: {
      'id': id
    },
    method: 'get'
  })
}

export const deleteCache = (id) => {
  return axios.request({
    url: `databases/manage/${id}`,
    method: 'delete'
  })
}

export const cleanDB = (data) => {
  return axios.request({
    url: '/databases/redis_opration/',
    data,
    method: 'delete'
  })
}
